package day2;

import java.io.FileNotFoundException;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;

public class Fruit {
     Object num()throws IOException {
        return 10;
    }
    public void print(){
        System.out.println("水果");
    }
    public static void main(String[] args) {
        Fruit f1=new Apple();
        Fruit f2=new Orange();
        Fruit f3=new Banana();
        f1.print();
        f2.print();
        f3.print();
    }
}
class Apple extends Fruit{

    public Integer num()throws IOException, FileNotFoundException {
        return 10;
    }
    public void print(){
        System.out.println("苹果");
    }
}
class Orange extends Fruit{
    public void print(){
        System.out.println("橘子");
    }
}
class Banana extends Fruit{
    public void print(){
        System.out.println("香蕉");
    }
}
class Test{
    static final String SEX="男";
    public static void main(String[] args) {
        Test t=new Test();
        System.out.println(t.SEX);
        System.out.println(Test.SEX);
        //t.SEX="女";
        //Test.SEX="女";
    }
}